#include "omdocument.h"
#include <QPixmap>

OMDocument::OMDocument()
        : mSecurityCodePixmap(0)
{
}

OMDocument::~OMDocument()
{
    safeFree();
}

QPixmap* OMDocument::securityCodePixmap(void)
{
    return mSecurityCodePixmap;
}

void OMDocument::loadFile(const QString& filePath)
{
    safeFree();

    mSecurityCodePixmap = new QPixmap(filePath);
    if(!mSecurityCodePixmap->isNull())
        fileLoaded();
}

void OMDocument::safeFree(void)
{
    if(0 != mSecurityCodePixmap)
    {
        delete mSecurityCodePixmap;
        mSecurityCodePixmap = 0;
    }
}
